<template>
  <div class="xiaobanxin">
    <div class="remen">
      <div>热门新碟</div>
      <ul>
        <li v-for="(item, index) in remenxindie.slice(0, 10)" :key="index">
          <img :src="item.blurPicUrl" alt="" />
          <p>{{ item.name }}</p>
          <p>{{ item.artists[0].name }}</p>
        </li>
      </ul>
    </div>
    <br />
    <div class="quanbu">
      <div class="kuang">
        <el-breadcrumb separator-class="el-icon-arrow-right">
          <el-breadcrumb-item :to="{ path: '/' }" style="font-size=22px"
            >全部新碟</el-breadcrumb-item
          >
          <el-breadcrumb-item>全部</el-breadcrumb-item>
          <el-breadcrumb-item>华语</el-breadcrumb-item>
          <el-breadcrumb-item>欧美</el-breadcrumb-item>
          <el-breadcrumb-item>韩国</el-breadcrumb-item>
          <el-breadcrumb-item>日本</el-breadcrumb-item>
        </el-breadcrumb>
      </div>
      <ul>
        <li v-for="(item, index) in quanbuxindie" :key="index">
          <img :src="item.blurPicUrl" alt="" />
          <p>{{ item.name }}</p>
          <p>{{ item.artists[0].name }}</p>
        </li>
      </ul>
      <div class="block">
        <el-pagination
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange"
          :current-page="currentPage"
          :page-sizes="[35, 70, 105, 140]"
          :page-size="pageSize"
          layout="total, sizes, prev, pager, next, jumper"
          :total="total"
        >
        </el-pagination>
      </div>
    </div>
  </div>
</template>

<script>
import { GetremenxindieApi, GetquanbuxindieApi } from "../../request/api";
export default {
  data() {
    return {
      //热门新碟
      remenxindie: [],
      //全部新碟
      quanbuxindie: [],
      total: 400,
      pageSize: 10,
      currentPage: 1,
    };
  },
  methods: {
    handleSizeChange(val) {
      this.pageSize = val;
    },
    handleCurrentChange(val) {
      this.currentPage = val;
    },
  },
  created() {
    GetremenxindieApi({ type: "hot" }).then((res) => {
      this.remenxindie = res.data.weekData;
      console.log(this.remenxindie);
    });
    GetquanbuxindieApi({ area: "All", limit: "35" }).then((res) => {
      this.quanbuxindie = res.data.albums;
      console.log(this.quanbuxindie);
    });
  },
};
</script>
 
<style lang = "less" scoped>
@import url(../../assets/base.less);
.remen {
  box-sizing: border-box;
  div {
    padding: 10px 0px;
    height: 30px;
    line-height: 30px;
    font-size: 22px;
    border-bottom: 3px solid red;
  }
  ul {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    li {
      width: 176px;
      margin: 10px;
      background-color: skyblue;
      img {
        width: 176px;
      }
      p {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        padding: 5px;
      }
    }
  }
}
.quanbu {
  div {
    padding: 10px 0px;
    height: 30px;
    line-height: 30px;
    font-size: 22px;
  }
  .kuang {
    padding: 10px 0px;
    height: 30px;
    line-height: 30px;
    font-size: 22px;
    border-bottom: 3px solid red;
  }
  ul {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    li {
      width: 176px;
      margin: 10px;
      background-color: skyblue;
      img {
        width: 176px;
      }
      p {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        padding: 5px;
      }
    }
  }
  .block {
    display: flex;
    margin-left: 30%;
  }
}
</style>